package com.hmall.user.config;

import com.hmall.user.interceptor.Myintercrptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

@Configuration
public class WebMvcConfig extends WebMvcConfigurationSupport {
    @Autowired
    Myintercrptor myintercrptor;

    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(myintercrptor)
                .addPathPatterns("/**")
                .excludePathPatterns("/employee/login","/backend/**","/front/**","/addr/**","/common/**","/user/sendMsg","/user/login");//放行静态资源和登陆资源
    }
}
